From c8af603a0726b3a3acb2f83a248b06b60c742cd8 Mon Sep 17 00:00:00 2001 From: "cl349@freefall.cl.cam.ac.uk" Date: Thu, 12 Aug 2004 15:54:04 +0000 Subject: [PATCH] bitkeeper revision 1.1159.17.19 (411b929cWqTc_xtMch0ol_CgtZ8PJQ) Merge 2.4 and 2.6 reboot code. --- .../arch/xen/kernel/Makefile | 3 ++- .../arch/xen/kernel/process.c | 21 ------------------- linux-2.4.26-xen-sparse/mkbuildtree | 1 + .../arch/xen/kernel/reboot.c | 19 ++++++++++------- 4 files changed, 14 insertions(+), 30 deletions(-) diff --git a/linux-2.4.26-xen-sparse/arch/xen/kernel/Makefile b/linux-2.4.26-xen-sparse/arch/xen/kernel/Makefile index 000e40934f..2d669c8f9e 100644 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/Makefile +++ b/linux-2.4.26-xen-sparse/arch/xen/kernel/Makefile @@ -10,7 +10,8 @@ export-objs := i386_ksyms.o obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ ptrace.o ioport.o ldt.o setup.o time.o sys_i386.o \ - i386_ksyms.o i387.o evtchn.o ctrl_if.o pci-dma.o + i386_ksyms.o i387.o evtchn.o ctrl_if.o pci-dma.o \ + reboot.o ifdef CONFIG_PCI obj-y += pci-i386.o pci-pc.o diff --git a/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c b/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c index 56cabca2a9..d03acd64a1 100644 --- a/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c +++ b/linux-2.4.26-xen-sparse/arch/xen/kernel/process.c @@ -115,27 +115,6 @@ void cpu_idle (void) } } -void machine_restart(char *__unused) -{ - /* We really want to get pending console data out before we die. */ - extern void xencons_force_flush(void); - xencons_force_flush(); - HYPERVISOR_reboot(); -} - -void machine_halt(void) -{ - machine_power_off(); -} - -void machine_power_off(void) -{ - /* We really want to get pending console data out before we die. */ - extern void xencons_force_flush(void); - xencons_force_flush(); - HYPERVISOR_shutdown(); -} - extern void show_trace(unsigned long* esp); void show_regs(struct pt_regs * regs) diff --git a/linux-2.4.26-xen-sparse/mkbuildtree b/linux-2.4.26-xen-sparse/mkbuildtree index 8396693b74..870df2cfbf 100755 --- a/linux-2.4.26-xen-sparse/mkbuildtree +++ b/linux-2.4.26-xen-sparse/mkbuildtree @@ -222,6 +222,7 @@ ln -sf ../../i386/kernel/semaphore.c ln -sf ../../i386/kernel/sys_i386.c ln -sf ../../../${LINUX_26}/arch/xen/kernel/ctrl_if.c ln -sf ../../../${LINUX_26}/arch/xen/kernel/evtchn.c +ln -sf ../../../${LINUX_26}/arch/xen/kernel/reboot.c ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/ioport.c ln -sf ../../../${LINUX_26}/arch/xen/i386/kernel/pci-dma.c diff --git a/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c b/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c index 9b39412746..f8c0f246ca 100644 --- a/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c +++ b/linux-2.6.7-xen-sparse/arch/xen/kernel/reboot.c @@ -1,8 +1,12 @@ +#include #include +#include #include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) int reboot_thru_bios = 0; /* for dmi_scan.c */ +#endif void machine_restart(char * __unused) { @@ -12,21 +16,18 @@ void machine_restart(char * __unused) HYPERVISOR_reboot(); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) EXPORT_SYMBOL(machine_restart); +#endif void machine_halt(void) { - /* We really want to get pending console data out before we die. */ - extern void xencons_force_flush(void); - xencons_force_flush(); - for ( ; ; ) /* loop without wasting cpu cycles */ - { - HYPERVISOR_shared_info->vcpu_data[0].evtchn_upcall_pending = 0; - HYPERVISOR_block(); - } + machine_power_off(); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) EXPORT_SYMBOL(machine_halt); +#endif void machine_power_off(void) { @@ -36,4 +37,6 @@ void machine_power_off(void) HYPERVISOR_shutdown(); } +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0) EXPORT_SYMBOL(machine_power_off); +#endif -- 2.30.2